<?php
$i = 0;
foreach ($homePageContent as $homePageContents):
    $class = 'men';
    if ($i == 0) {
        $class = 'women';
    }
    $i++;
?>
    <div class="<?php echo $class; ?>">
        <div class="title brandindex"><?php echo $homePageContents['category']; ?></div>
        <div class="subtitle">
            <?php foreach ($homePageContents as $key => $value): ?>
                <?php if ($key != 'category'): ?>
                    <label><?php echo $key; ?></label>
                <?php endif; ?>
            <?php endforeach; ?>
        </div>
        <div class="porduct-con">
            <?php unset($homePageContents['category']);?>
            <?php if ($homePageContents["Ending Soon"] OR $homePageContents["Newest"]): foreach ($homePageContents as $key => $value): ?>
                    <ul>
                        <?php foreach ($value as $values): ?>
                            <li><div style="height:150px;overflow:hidden;background-color:#F9F9F9">
                                    <a href="<?php echo Configure::read('base_url'); ?>products/details/<?php echo $values['Product']['id']; ?>" title="<?php echo $values['Product']['products_title']; ?>">
                                        <?php
                                        $image = "thumbs/";
                                        echo $html->image($image . $thumbnail->render($values['Product']['products_thumbnailImage'], array('path' => 'thumbs', 'width' => 140, 'height' => 140, 'quality' => 80)
                                                ), array('alt' => $values['Product']['products_title'], 'class' => 'shuffle')
                                        );
                                        ?></a>
                                </div>
                                <div style="height:30px;overflow:hidden;">
                                    <a href="<?php echo Configure::read('base_url'); ?>products/details/<?php echo $values['Product']['id']; ?>" title="<?php echo $values['Product']['products_title']; ?>"><?php echo $values['Product']['products_title']; ?></a>
                                </div>
                                <p>$<?php echo $values['Product']['products_price']; ?></p>
                                <span><a href="<?php echo Configure::read('base_url'); ?>products/store/<?php echo $values['Product']['user_id']; ?>"><?php echo $values['User']['username']; ?></a></span>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                <?php endforeach;
            else: echo"<b>No Product Available.</b>";
            endif; ?>
            <div class="clear"></div>
        </div>
    </div>
<?php endforeach; ?>
<!--Start slider-->
<div id="wrap" style="position:relative; clear:both; margin:11px 0 0 0;">
    <ul id="mycarousel" class="jcarousel-skin-tango">
                    <?php foreach ($homePageSlider as $product): ?>
            <li style="text-align: center; border: 1px solid #EFEFEF;">
                <div style="height:150px;overflow:hidden;background-color:#F9F9F9"><a href="<?php echo Configure::read('base_url'); ?>products/details/<?php echo $product['Product']['id']; ?>" title="<?php echo $product['Product']['products_title']; ?>">
                        <?php
                        $image = "thumbs/";
                        echo $html->image($image . $thumbnail->render($product['Product']['products_thumbnailImage'], array('path' => 'thumbs', 'width' => 140, 'height' => 140, 'quality' => 80)
                                ), array('alt' => $product['Product']['products_title'])
                        );
                        ?>
                    </a>
                </div>
                <p class="hpittt"><a href="<?php echo Configure::read('base_url'); ?>products/details/<?php echo $product['Product']['id']; ?>" title="<?php echo $product['Product']['products_title']; ?>">
                        <?php
                        echo $this->Text->truncate($product['Product']['products_title'], 25, array(
                            'ending' => '...',
                            'exact' => false
                        ));
                        ?></a></p>
                <p class="gasp">$ <?php echo $product['Product']['products_price']; ?></p>
            </li>
<?php endforeach; ?>
    </ul>
</div>
<!--End Slider-->